package com.demo;

import com.demo.ThreadTest.RunableDemo;
import com.demo.ThreadTest.ThreadDemo;

public class Demo1 {
    public static void main(String[] args) throws InterruptedException {
        System.out.println("main start1");
        ThreadDemo t1 = new ThreadDemo("t1");
        Thread t2 = new Thread(new RunableDemo("t2"));
        Thread t3 = new Thread(() -> {
            try {
                Thread.sleep(30);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println("runing: t3");
        });

        t1.start();
        t2.start();
        t3.start();
        Thread.sleep(30);
        System.out.println("main end");
    }
}
